using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ModelTools._Iterator
{
    /// <summary>
    /// <para>Iterate Feature Selection</para>
    /// <para>Iterates over features in a feature class.</para>
    /// <para>对要素类中的要素进行迭代。</para>
    /// </summary>    
    [DisplayName("Iterate Feature Selection")]
    public class IterateFeatureSelection : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public IterateFeatureSelection()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>In Features</para>
        /// <para>The input feature class or layer containing features to iterate.</para>
        /// <para>包含要迭代的要素的输入要素类或图层。</para>
        /// </param>
        public IterateFeatureSelection(object _in_features)
        {
            this._in_features = _in_features;
        }
        public override string ToolboxName => "Model Tools";

        public override string ToolName => "Iterate Feature Selection";

        public override string CallName => "mb.IterateFeatureSelection";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_features, _fields, _skip_nulls, _selection, _value];

        /// <summary>
        /// <para>In Features</para>
        /// <para>The input feature class or layer containing features to iterate.</para>
        /// <para>包含要迭代的要素的输入要素类或图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("In Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Group By Fields</para>
        /// <para>The input field or fields used to group the features for selection. Any number of input fields can be defined, resulting in a selection based on a unique combination of the fields. If a field is not specified, the Object ID is used to iterate over features.</para>
        /// <para>用于对要选择的要素进行分组的一个或多个输入字段。可以定义任意数量的输入字段，从而根据字段的唯一组合进行选择。如果未指定字段，则对象 ID 用于迭代要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Group By Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _fields { get; set; } = null;


        /// <summary>
        /// <para>Skip Null Values</para>
        /// <para><xdoc>
        ///   <para>Specifies whether null values in the grouping field or fields are skipped during selection.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Skip through all the null values in the grouping fields during selection.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Set as default. Include all the null values in the grouping fields during selection. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在选择过程中是否跳过分组字段中的空值。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 在选择过程中跳过分组字段中的所有空值。</bullet_item><para/>
        ///     <bullet_item>未选中 - 设置为默认值。在选择过程中，在分组字段中包括所有 null 值。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Skip Null Values")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _skip_nulls { get; set; } = null;


        /// <summary>
        /// <para>Selected Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Selected Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _selection { get; set; }


        /// <summary>
        /// <para>Value</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Value")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _value { get; set; }


        public IterateFeatureSelection SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}